import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
import {AppService} from "../../services/AppService";
import {TabsPage} from "../tabs/tabs";

/*
  Generated class for the Login page.

  See http://ionicframework.com/docs/v2/components/#navigation for more info on
  Ionic pages and navigation.
*/
@Component({
  selector: 'page-login',
  templateUrl: 'login.html'
})
export class LoginPage {

  constructor(public navCtrl: NavController, public navParams: NavParams, public appService: AppService) {}

  username: string;
  password: string;

  doLogin()
  {
    this.appService.getToken(this.username, this.password).then(() => {
      this.navCtrl.setRoot(TabsPage);
    });
  }

}
